home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
video
/
trojka.tgz
/
trojka.tar
/
trojka
/
trojka.h
< prev
Wrap
C/C++ Source or Header
|
1995-10-20
|
2KB
|
106 lines
/*
* @(#) trojplpl.h -- Header file for TROJKA
* created: 4.iii.1992
* last update: 25.ii.1994
*/
#ifndef _trojka_h_
#define _trojka_h
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef unsigned char flag;
/*
* virtual-field defines
*/
/* layout of the virtual matrix
______________
21 |__|__|__|__|__|<-------- buffer space for scanning,
20 PLM_TOP |__|__|__|__|__|<--. contents are always 0
19 | | | | | | \
18 | | \ actual PLaying Matrix, where the
.. : : > on-screen visible blocks are stored
2 |__|__|__|__|__| /
1 PLM_BOTTOM |__|__|__|__|__|<---'
0 |__|__|__|__|__|<-------- buffer space for bottom,
0 1 2 3 4 contents are always != 0
^_ _ _ _ _ _ VIRT_MIDDLE
*/
#define VIRT_XSIZE 5 /* dimensions of virtual field-array */
#define VIRT_YSIZE 22
#define VIRT_MIDDLE 2 /* middle of virtual field */
#define PLM_TOP 20 /* constants for PLaying Matrix, */
#define PLM_BOTTOM 1 /* see explanation above */
#define CLEAR 0 /* empty space for fieldarray */
#define TAGGED -1 /* tagged field element, ready to be wiped */
/*
* end of virtual field defines
*/
#define X_MIN 32 /* oriented on 1..80x1..25 screen !!!! */
#define X_MAX 48
#define STATX (X_MAX + 12)
/*
* general
*/
#define BLOCKS 5
#define MAXSPEED 9
#define MESGS 19 /* number of cookies */
#define MAX_MESG_TIME 10
#define MESG_SWITCH 10000
#define SPEED_SWITCH 100
#define TROJKA 3 /* ..it's the magic number (yes, it is) */
/*
* game-control-keys
*/
#define LF 0x0a /* line feed */
#define CR 0x0d /* carriage return */
#define BACKSP '\b' /* back space */
#define SPACE ' ' /* SPACE*/
#define QUIT 'q'
#define REDRAW 12 /* redraw screen */
#define LEFT '4'
#define RIGHT '6'
#define DROP '2'
#define SPEEDUP '7'
#define INSDROP '0'
/* vi - compatibility */
#define VIRIGHT 'l'
#define VILEFT 'h'
#define VIDROP 'j'
#define VISPEEDUP 'k'
#define qprintf printw
#define movexy(x, y) move((y)-1, (x)-1)
#define getrandom(s) (rand() % (s))
#define setrandom() srand((unsigned)time(0))
#define clear_scr() clear();refresh()
#define clreol() clrtoeol()
#endif _trojka_h_